<nz-page-header class="site-page-header">
  <nz-page-header-title>{{roleName}}</nz-page-header-title>
  <nz-page-header-subtitle>{{roleId}}</nz-page-header-subtitle>
  <nz-page-header-extra>
    <button nz-button nzType="primary" (click)="search()">查询</button>
  </nz-page-header-extra>
</nz-page-header>

<div class="table-div" >
  <nz-table #smallTable [nzData]="menus" nzSize="small" [nzFrontPagination]="false"
            [nzLoading]="loading" [nzLoadingDelay]="300" >
    <thead>
    <tr>
      <th>菜单名字</th>
      <th>PATH</th>
      <th>是否已有</th>
      <th>操作</th>
    </tr>
    </thead>
    <tbody>
    <ng-container *ngFor="let data of smallTable.data">
    <tr *ngIf="isShow(data)" [ngClass]="{'has-menu':data.isHasMenu === '1'}">
      <td [nzIndentSize]="data.level * 15" [(nzExpand)]="data.expand"
          [nzShowExpand]="!!data.children">{{ data.menuName }}</td>
      <td>{{ data.menuPath }}</td>
      <td>{{ data.isHasMenu | enablePipe }}</td>
      <td>
        <button nz-button nzType="link" nzSize="small" *ngIf="data.isHasMenu == '1'"
                [nzPopconfirmTitle]="deleteConfirmMessage(data)"  nz-popconfirm
                (nzOnConfirm)="delete(data.menuId)">
          <i nz-icon nzType="delete" nzTheme="outline"></i>delete
        </button>
        <button nz-button nzType="link" nzSize="small" *ngIf="data.isHasMenu == '2'" (click)="add(data.menuId)">
          <i nz-icon nzType="plus" nzTheme="outline"></i>add
        </button>
      </td>
    </tr>
    </ng-container>
    </tbody>
  </nz-table>
</div>
